package cn.quang.search.admin.mapper;

import cn.quang.search.admin.entity.po.SearchSceneConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author:  Entity Generator
 * @since:  2024-02-28 11:21:56
 */
public interface SearchSceneConfigMapper extends BaseMapper<SearchSceneConfig> {

    @Select(
            " SELECT * FROM search_scene_config WHERE config_id = #{fieldDicId} and config_type = 3 "
    )
    List<SearchSceneConfig> selectByFieldDicId(@Param("fieldDicId") long fieldDicId);

    @Select(
            " SELECT * FROM search_scene_config WHERE config_id = #{logicTableId} and config_type = 1 "
    )
    List<SearchSceneConfig> selectByLogicTableId(@Param("logicTableId") long logicTableId);

    @Select(
            " SELECT * FROM search_scene_config WHERE config_id = #{conditionId} and config_type = 2 "
    )
    List<SearchSceneConfig> selectByConditionId(@Param("conditionId") long conditionId);

    @Select(
            " SELECT * FROM search_scene_config WHERE scene_id = #{sceneId} "
    )
    List<SearchSceneConfig> selectBySceneId(@Param("sceneId") long sceneId);
}
